package Data;

// n - north, s - south, e - east, w - west, ne - north east ...
/*       N    
 *   NW--|--NE
 * W --------- E
 *   SW--|--SE
 *       S
 */      

public enum Directions implements java.io.Serializable  {
	MOVE_NORTH(0),
	MOVE_SOUTH(1),
	MOVE_EAST(2),
	MOVE_WEST(3),
	MOVE_NE(4), // north east
	MOVE_SE(5), // south east
	MOVE_SW(6), // south west
	MOVE_NW(7); // north west

	private int code;
    public static int directionLength = 8;
    
	 private Directions(int c) {
	   code = c;
	 }

	 public int getCode() {
	   return code;
	 }
	 
	 public static Directions getDirection(int code) {
	   switch(code) {
	    case 0: return MOVE_NORTH;  
	    case 1: return MOVE_SOUTH; 
	    case 2: return MOVE_EAST;
	    case 3: return MOVE_WEST;
	    case 4: return MOVE_NE;
	    case 5: return MOVE_SE;
	    case 6: return MOVE_SW;
	    case 7: return MOVE_NW;
	    default: return MOVE_NORTH;
	   }
	 }
}
